package org.vison.wonfu.framework.soa.spi;
import java.lang.reflect.*;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.Future;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


import org.springframework.context.ApplicationContext;
import org.vison.wonfu.framework.soa.protocol.SoaRefProxyInvoke;

public class SoaRefProxyFactory {
    private static final Logger logger = LoggerFactory.getLogger(SoaRefProxyFactory.class);
    @SuppressWarnings("unchecked")
    public static <T> T createProxy(Field field, ApplicationContext applicationContext) {
        return (T) Proxy.newProxyInstance(
                field.getType().getClassLoader(),
                new Class<?>[]{field.getType()},
                new SoaRefProxyInvoke(applicationContext,field)
        );
    }




}